package yzy.ecps.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import yzy.ecps.dao.BrandDao;
import yzy.ecps.model.BtcBrand;
import yzy.ecps.service.BrandService;

@Service
public class BrandServiceImpl implements BrandService {
	
	@Autowired
	private BrandDao brandDao;
	
	public List<BtcBrand> findAll() {
		return brandDao.findAll();
	}

	public void saveBrand(BtcBrand brand) {
		brandDao.saveBrand(brand);
	}

	public BtcBrand getById(Long brandId) {
		return brandDao.getById(brandId);
	}

	public void updateBrand(BtcBrand brand) {
		brandDao.updateOne(brand);
	}

	public void deleteById(Long brandId) {
		brandDao.deleteById(brandId);
	}

	public List<BtcBrand> findByName(String brandName) {
		return brandDao.findByName(brandName);
	}

}
